<div>
  <div style="overflow: auto;" class="GridView">
    <div style="overflow: auto;" class="GridView" id="SearchFilterListView">
      <div>
        <div style="" class="TitleBarView">
          <h1><?php echo $this->navText;?></h1>
        </div>
      </div>
      <div>
        <div style="overflow: auto;" class="SearchView SearchView ModelView ConfigurableMetadataView MetadataView" id="AccountsSearchView">
          <div class="wide form">
          <?php $form=$this->beginWidget('CActiveForm', array(
					'id'=>'section-serach-form',
					'enableAjaxValidation'=>false,
					'action'=>$this->createUrl('comment/search', array('bookFlag'=>$book->nameFlag))
			)); ?>
              <table>
                <colgroup>
                <col style="width:20%">
                <col style="width:30%">
                <col style="width:20%">
                <col style="width:30%">
                </colgroup>
                <tbody class="search-view-0">
                  <tr>
                    <th><?php echo $form->labelEx($searchModel,'name'); ?></th>
                    <td colspan="1"><?php echo $form->textField($searchModel,'name',array('maxlength'=>14)); ?></td>
                    <th><?php echo $form->labelEx($searchModel,'clientIp'); ?></th>
                    <td colspan="1"><?php echo $form->textField($searchModel,'clientIp',array('maxlength'=>14)); ?></td>
                  </tr>
                  <tr>
                    <th><?php echo $form->labelEx($searchModel,'email'); ?></th>
                    <td colspan="1"><?php echo $form->textField($searchModel,'email',array('maxlength'=>14)); ?></td>
                    <th><?php echo $form->labelEx($searchModel,'comment'); ?></th>
                    <td colspan="1"><?php echo $form->textField($searchModel,'comment',array('maxlength'=>14)); ?></td>
                  </tr>
                  <tr>
                    <th><?php echo $form->labelEx($searchModel,'sectionId'); ?></th>
                    <td colspan="1"><?php echo $form->textField($searchModel,'sectionId',array('maxlength'=>14)); ?></td>
                    <th><?php echo $form->labelEx($searchModel,'chapterId'); ?></th>
                    <td colspan="1"><?php echo $form->textField($searchModel,'chapterId',array('maxlength'=>14)); ?></td>
                  </tr>
                </tbody>
                <tbody class="search-view-bottom-panel">
                  <tr>
                    <td colspan="4">
                      <?php echo CHtml::submitButton('搜索'); ?>
					&nbsp; <?php echo CHtml::link('清除搜索', array('index', 'bookFlag'=>$book->nameFlag));?>
					&nbsp; | &nbsp;
                      <?php echo CHtml::link('返回书籍管理', array('book/index', 'bookFlag'=>$book->nameFlag));?>
                    </td>
                  </tr>
                </tbody>
              </table>
		  <?php $this->endWidget(); ?>
          </div>
        </div>
      </div>
      <div>
        <div style="overflow: auto;" class="SecuredListView ListView ModelView ConfigurableMetadataView MetadataView" id="ListView">
          <div class="view-toolbar"></div>
          <div id="list-view" class="cgrid-view">
            <?php if ($comments!=false) :?>
            <div class="summary">最新<?php echo count($comments);?>条评论</div>
            <?php endif; ?>
            <table class="items"  style="table-layout:fixed">
              <thead>
                <tr>
                  <th id="list-view_c1" style="width:10%;">时间</th>
                  <th id="list-view_c2" style="width:5%;">章节Id</th>
                  <th id="list-view_c3" style="width:5%;">段落Id</th>
                  <th id="list-view_c4" style="width:5%;">昵称</th>
                  <th id="list-view_c5" style="width:10%;">邮箱</th>
                  <th id="list-view_c6" style="width:5%">站点</th>
                  <th id="list-view_c7" style="width:30%">评论内容</th>
                  <th id="list-view_c8" style="width:10%;">客户Ip</th>
                  <th id="list-view_c9" class="button-column" style="width:20%;">操作</th>
                </tr>
              </thead>
              <tbody>
              	<?php if ($comments==false) :?>
                <tr>
                  <td colspan="9"><span class="empty">无内容</span></td>
                </tr>
                <?php else :?>
                <?php foreach($comments as $comment) :?>
	                <tr>
	                  <td><?php echo date("Y-m-d H:i:s", $comment['addTime']);?></td>
	                  <td><?php echo $comment['chapterId'];?></td>
	                  <td><?php echo $comment['sectionId'];?></td>
	                  <td><?php echo CHtml::encode($comment['name']);?></td>
	                  <td><?php echo CHtml::encode($comment['email']);?></td>
	                  <td><?php echo CHtml::encode($comment['website']);?></td>
	                  <td><?php echo CHtml::encode($comment['comment']);?></td>
					  <td><?php echo $comment['clientIp'];?></td>
	                  <td>
	                  <?php 
		                  echo CHtml::ajaxLink(
		                  						'回复此评论', 
		                  						array('comment/reply', 'bookFlag'=>$book->nameFlag, 'chapterId'=> $comment['chapterId'], 'sectionId'=> $comment['sectionId']),
		                  						array('success'=>'js:function(html){ jQuery("#reply_comment").html(html);	jQuery("#reply_comment").dialog("open"); }')
		                  		);
		              ?>
	                   <br />
	                  <?php 
	                  	echo CHtml::link('翻译此段落', array('translate', 'bookFlag'=>$book->nameFlag, 'commentId'=>$comment['commentId']));
	                  ?>
	                   <br /> 
	                  <?php 
	                  	echo CHtml::link('删除此评论', array('delete', 'bookFlag'=>$book->nameFlag, 'commentId'=>$comment['commentId']), array('onclick'=>'if (confirm("确定要删除此条评论吗？")) return true; else return false;'));
	                  ?>
	                  
		              </td>
	                </tr>
	            <?php endforeach; ?>
                <?php endif;?>
                
              </tbody>
            </table>
            <div title="/index.php?r=accounts/default" style="display:none" class="keys"></div>
          </div>
          <input type="hidden" id="list-view-selectedIds" name="list-view-selectedIds" value="">
          <input type="hidden" id="list-view-selectAll" name="list-view-selectAll" value="">
        </div>
      </div>
    </div>
  </div>
</div>
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id'=>'reply_comment', 'options'=>array('modal'=>true, 'maxWidth'=>600, 'minWidth'=>600, 'maxHeight'=>450, 'minHeight'=>450, 'title'=>'回复评论', 'autoOpen'=>false)));
?>
&nbsp;
<?php 
$this->endWidget(); 
?>
